﻿@model IEnumerable<SimplCommerce.Module.Orders.Areas.Orders.ViewModels.OrderHistoryListItem>

@{
    ViewData["Title"] = Localizer["Order History"];
}

<div class="row">
    <div class="col-md-3">
        <partial name="_AccountMenu" />
    </div>
    <div class="col-md-9">
        <h2>@ViewData["Title"]</h2>
        <hr />
        <table class="table table-striped order-history">
            <tr>
                <th>@Localizer["Order Id"]</th>
                <th>@Localizer["Date"]</th>
                <th>@Localizer["Products"]</th>
                <th>@Localizer["SubTotal"]</th>
                <th>@Localizer["Status"]</th>
            </tr>
            @foreach (var order in Model)
            {
                <tr>
                    <td><a href="~/user/orders/@order.Id">@order.Id</a></td>
                    <td>@order.CreatedOn.DateTime.ToShortDateString()</td>
                    <td>
                        @foreach (var item in order.OrderItems)
                        {
                            <div class="row">
                                <div class="col-md-3">
                                    <img src="@item.ThumbnailImage" />
                                </div>
                                <div class="col-md-9">
                                     <p>@item.ProductName</p>
                                     <p>Quantity @item.Quantity</p>
                                </div>
                            </div>
                        }
                    </td>
                    <td>@order.SubTotalString</td>
                    <td>@order.OrderStatus</td>
                </tr>
            }
        </table>
    </div>
</div>
